package li.webqq.api;

import li.http.Request;
import li.webqq.Const;
import li.webqq.util.StringUtil;

import org.apache.log4j.Logger;

/**
 * @author 明伟
 */
public class Login2Request extends Request implements Const {
    private static final Logger logger = Logger.getLogger(Login2Request.class);

    public Login2Response execute() {
        logger.info("Login2Request execute");

        String r = StringUtil.build(R_LOGIN2, getCookie("ptwebqq"));
        logger.info("r=" + r);

        super.setUrl(URL_LOGIN2);
        super.setReferer(URL_PROXY);
        super.setContentType(FORM_URLENCODED);

        super.setField("r", StringUtil.encode(r));
        // super.setField("clientid", CLIENT_ID);
        // super.setField("psessionid", "null");

        return super.execute(new Login2Response());
    }
}